package com.health.ts.config;
 
import javax.xml.ws.Endpoint;

import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.health.ts.webservice.DemoService;
 
@Configuration
public class CxfConfig {
	
    @Autowired
    private Bus bus;
    
    @Autowired
    DemoService demoService;
    
    /**
     * 发布服务
     * 指定访问url
     * @return
     */
    @Bean
    public Endpoint demoEndpoint(){
        EndpointImpl endpoint = new EndpointImpl(bus,demoService);
        endpoint.publish("/demoService");
        return endpoint;
    }
}